package com.kinggm.service.strategy;


import com.kinggm.service.strategy.abs.Duck;
import com.kinggm.service.strategy.abs.impl.MallardDuck;
import com.kinggm.service.strategy.abs.impl.RubberDuck;
import com.kinggm.service.strategy.service.impl.GagaQuark;
import com.kinggm.service.strategy.service.impl.NoneFly;
import com.kinggm.service.strategy.service.impl.RealFly;
import com.kinggm.service.strategy.service.impl.ZzQuark;

public class StrategyTest {
    public static void main(String[] args) {
        Duck mallardDuck = new MallardDuck();
        mallardDuck.setName("绿头鸭！");
        mallardDuck.setQuark(new GagaQuark());
        mallardDuck.setFly(new RealFly());
        mallardDuck.swim();
        mallardDuck.fly();


        Duck rubberDuck = new RubberDuck();
        rubberDuck.setName("橡皮鸭！");
        rubberDuck.setQuark(new ZzQuark());
        rubberDuck.setFly(new NoneFly());
        rubberDuck.swim();
        rubberDuck.fly();

    }
}
